<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
  <script src="lib/vue.js"></script>
</head>
<body>
<div id="root">
  <one ref="one"></one>
  <button @click="fn">点我</button>
</div>
</body>
<script>
  new Vue({
    el : '#root',
    methods:{
      fn(){
        console.log(this.$refs.one);
        this.$refs.one.num++;
      }
    },
    components:{
      One:{
        data(){
          return {
            num :1
          }
        },
        template:(`
          <h3>{{num}}</h3>
        `)
      }
    }
  })
</script>
</html>